package com.gxa.weixing.core.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author lijianmin
 * @date 2022/01/05  22:25:30
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_goods")
@ApiModel(value = "商品对象")
public class Goods {
    /**
     * 商品编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "goods_id")
    @ApiModelProperty(name = "id", value = "编号", dataType = "Long", example = "1")
    @ExcelProperty(value = "编号", index = 0)
    private Long id;

    /**
     * 商品名称
     */
    @Column(name = "goods_name")
    @ApiModelProperty(name = "name", value = "商品名称", dataType = "String", example = "富士康苹果")
    @ExcelProperty(value = "名称", index = 1)
    private String name;

    /**
     * 商品现价 商品真实价格
     */
    @Column(name = "goods_price")
    @ApiModelProperty(name = "price", value = "商品现价", dataType = "BigDecimal", example = "8.3")
    @ExcelProperty(value = "商品现价", index = 2)
    private BigDecimal price;

    /**
     * 商品原价/市场价格 用于下划线删除的原价
     */
    @Column(name = "goods_pre_price")
    @ApiModelProperty(name = "prePrice", value = "商品原价", dataType = "BigDecimal", example = "13.9")
    @ExcelProperty(value = "商品原价", index = 3)
    private BigDecimal prePrice;

    /**
     * 采购价格
     */
    @Column(name = "goods_purchase_price")
    @ApiModelProperty(name = "purchasePrice", value = "采购价格", dataType = "BigDecimal", example = "14.6")
    @ExcelProperty(value = "采购价格", index = 4)
    private BigDecimal purchasePrice;

    /**
     * 商品描述
     */
    @Column(name = "goods_desc")
    @ApiModelProperty(name = "desc", value = "商品描述", dataType = "String", example = "商品描述")
    @ExcelProperty(value = "商品描述", index = 5)
    private String desc;

    /**
     * 商品封面
     */
    @Column(name = "goods_img")
    @ApiModelProperty(name = "img", value = "商品封面", dataType = "String", example = "商品封面地址")
    @ExcelProperty(value = "商品封面", index = 6)
    private String img;

    /**
     * 商品状态(0 草稿/1 在售/2 停售)
     */
    @Column(name = "goods_state")
    @ApiModelProperty(name = "state", value = "商品状态(0 草稿/1 在售/2 停售)", dataType = "Integer", example = "1")
    @ExcelProperty(value = "商品状态", index = 7)
    private Integer state;

    private GoodsDetail goodsDetail;

}
